package com.tang.crm.config;

import com.tang.crm.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * springMVC配置
 * @author SHIRELY阳
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    /**
     * 配置拦截器的路径
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**")
                .excludePathPatterns("/index", "/login","/user/login", "/css/**", "/images/**", "/js/**", "/lib/**");
    }
}
